package com.yhq.thrift.demo.springclient;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by yhq on 2016/12/6.
 */
@Controller
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private ThriftProxyFactory factory;

    @RequestMapping("/say")
    @ResponseBody
    public String say() throws Exception {
        int result = factory.getCalculator().add(1,2);
        return "hello" + result;
    }
}
